#pragma once
#include<iostream>
#include<string>
#include<sys/types.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include<arpa/inet.h>




class InetAddr
{
public:
    InetAddr(struct sockaddr_in &addr)
    {
        ip=inet_ntoa(addr.sin_addr);
        port=ntohs(addr.sin_port);
    }
    std::string IP(){return ip;}
    uint16_t Port(){return port;}
    std::string PrintDebug()
    {
        std::string info=ip;
        info+=":";
        info+=std::to_string(port);
        return info;
    }
    ~InetAddr()
    {}
private:
    std::string ip;
    uint16_t port;
};